package thread;

public class ThreadDemo17 {
    public static void main(String[] args) {
        Thread t1 = new Thread(() ->{
           Thread t = Thread.currentThread();
            System.out.println(t.getName());
            //不能使用this来获取当前线程
            //只能是继承Thread里面的类能直接通过this来获取当前线程
        });
        Thread t2 = new Thread(() ->{
            Thread t = Thread.currentThread();
            System.out.println(t.getName());
        });
        t1.start();
        t2.start();
    }
}
